package com.pan.behavioral.stratergy.game;

import com.pan.behavioral.stratergy.pattern.Strategy;

import javax.swing.*;

@Deprecated
public class RandomStrategy implements Strategy {

    private JButton jButton;
    private int xLimit;
    private int yLimit;
    private int width;
    private int height;
    public RandomStrategy(int winWidth,int winHeight,JButton jButton){
        this.width = jButton.getWidth();
        this.height = jButton.getHeight();
        this.xLimit = winWidth - width;
        this.yLimit = winHeight - height;
        this.jButton = jButton;

    }

    public void operation() {
        this.jButton.setBounds((int) (Math.random()*xLimit), (int) (Math.random()*yLimit),width,height);
    }

    @Override
    public Object operation(Object data) {
        return null;
    }
}

